-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ObsUX][Infra] Add telemetry for anomaly job creation #198061
[ObsUX][Infra] Add telemetry for anomaly job creation #198061
Conversation
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
setPartitionField(value.map((v) => v.label)); | ||
telemetry.reportAnomalyDetectionPartitionFieldChange({ | ||
job_type: props.jobType, | ||
partition_field: value.length > 0 ? value[0].label : null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Shouldn't the partition_field
accept an array in this case? If there is more than 1 label, this will report a incorrect info, wouldn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked again because I thought looking at the code that would be possible, but the UI doesn't let you select more than one, so it's all of them or just one field.
But yeah, it doesn't work as it is (without selecting one), I'll fix it
Thanks for spotting this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After further investigation, I can confirm that is NOT possible to set more than one value for partition_field
, I'm unsure why the code treat it as an array though, when we setup the ml module (job) partitionField
is string
or undefined
, you can see the setupModule
function in infra/public/containers/ml/infra_ml_module.tsx
(I can't link the file because of the incident with the repos)
Still there was an error in the telemetry types as partition_field
should be optional
, I'll also male filter_field optional
Amazing @MiriamAparicio - LGTM! |
⏳ Build in-progress
History
|
Starting backport for target branches: 8.16 |
Closes elastic#189619 Telemetry events created: - Infra Anomaly Detection Job Setup ``` { "event_type":"Infra Anomaly Detection Job Setup", "context":{...} "properties": { "job_type":"host", "configured_fields":{"start_date":"2024-09-24T16:11:41.446Z","partition_field":"cloud.instance.id","filter_field": "host.name:\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\"} } } ``` - Infra Anomaly Detection Job Date Field Change ``` { "event_type":" Infra Anomaly Detection Job Date Field Change", "context":{...} "properties": { "job_type":"host", "start_date":"2024-09-24T16:11:41.446Z" } } ``` - Infra Anomaly Detection Job Partition Field Change ``` { "event_type":" Infra Anomaly Detection Job Date Field Change", "context":{...} "properties": { "job_type":"host", "partition_field":"cloud.instance.id" } } ``` - Infra Anomaly Detection Job Filter Field Change ``` { "event_type":" Infra Anomaly Detection Job Date Field Change", "context":{...} "properties": { "job_type":"host", "filter_field": "host.name:\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\" } } ``` (cherry picked from commit 227aaf3)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
#198442) # Backport This will backport the following commits from `main` to `8.16`: - [[ObsUX][Infra] Add telemetry for anomaly job creation (#198061)](#198061) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Miriam","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-30T20:45:48Z","message":"[ObsUX][Infra] Add telemetry for anomaly job creation (#198061)\n\nCloses https://github.com/elastic/kibana/issues/189619\r\n\r\nTelemetry events created:\r\n\r\n- Infra Anomaly Detection Job Setup\r\n```\r\n{\r\n \"event_type\":\"Infra Anomaly Detection Job Setup\",\r\n \"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n \"configured_fields\":{\"start_date\":\"2024-09-24T16:11:41.446Z\",\"partition_field\":\"cloud.instance.id\",\"filter_field\": \"host.name:\\\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\\\"}\r\n } \r\n}\r\n```\r\n- Infra Anomaly Detection Job Date Field Change\r\n```\r\n{\r\n \"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n \"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n \"start_date\":\"2024-09-24T16:11:41.446Z\"\r\n } \r\n}\r\n```\r\n- Infra Anomaly Detection Job Partition Field Change\r\n```\r\n{\r\n \"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n \"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n \"partition_field\":\"cloud.instance.id\"\r\n } \r\n}\r\n```\r\n- Infra Anomaly Detection Job Filter Field Change\r\n```\r\n{\r\n \"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n \"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n \"filter_field\": \"host.name:\\\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\\\"\r\n } \r\n}\r\n```","sha":"227aaf3e14448282894bcbc422531a04dd949f4a","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","ci:project-deploy-observability","Team:obs-ux-infra_services","v8.16.0","backport:version"],"title":"[ObsUX][Infra] Add telemetry for anomaly job creation","number":198061,"url":"https://github.com/elastic/kibana/pull/198061","mergeCommit":{"message":"[ObsUX][Infra] Add telemetry for anomaly job creation (#198061)\n\nCloses https://github.com/elastic/kibana/issues/189619\r\n\r\nTelemetry events created:\r\n\r\n- Infra Anomaly Detection Job Setup\r\n```\r\n{\r\n \"event_type\":\"Infra Anomaly Detection Job Setup\",\r\n \"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n \"configured_fields\":{\"start_date\":\"2024-09-24T16:11:41.446Z\",\"partition_field\":\"cloud.instance.id\",\"filter_field\": \"host.name:\\\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\\\"}\r\n } \r\n}\r\n```\r\n- Infra Anomaly Detection Job Date Field Change\r\n```\r\n{\r\n \"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n \"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n \"start_date\":\"2024-09-24T16:11:41.446Z\"\r\n } \r\n}\r\n```\r\n- Infra Anomaly Detection Job Partition Field Change\r\n```\r\n{\r\n \"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n \"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n \"partition_field\":\"cloud.instance.id\"\r\n } \r\n}\r\n```\r\n- Infra Anomaly Detection Job Filter Field Change\r\n```\r\n{\r\n \"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n \"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n \"filter_field\": \"host.name:\\\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\\\"\r\n } \r\n}\r\n```","sha":"227aaf3e14448282894bcbc422531a04dd949f4a"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198061","number":198061,"mergeCommit":{"message":"[ObsUX][Infra] Add telemetry for anomaly job creation (#198061)\n\nCloses https://github.com/elastic/kibana/issues/189619\r\n\r\nTelemetry events created:\r\n\r\n- Infra Anomaly Detection Job Setup\r\n```\r\n{\r\n \"event_type\":\"Infra Anomaly Detection Job Setup\",\r\n \"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n \"configured_fields\":{\"start_date\":\"2024-09-24T16:11:41.446Z\",\"partition_field\":\"cloud.instance.id\",\"filter_field\": \"host.name:\\\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\\\"}\r\n } \r\n}\r\n```\r\n- Infra Anomaly Detection Job Date Field Change\r\n```\r\n{\r\n \"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n \"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n \"start_date\":\"2024-09-24T16:11:41.446Z\"\r\n } \r\n}\r\n```\r\n- Infra Anomaly Detection Job Partition Field Change\r\n```\r\n{\r\n \"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n \"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n \"partition_field\":\"cloud.instance.id\"\r\n } \r\n}\r\n```\r\n- Infra Anomaly Detection Job Filter Field Change\r\n```\r\n{\r\n \"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n \"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n \"filter_field\": \"host.name:\\\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\\\"\r\n } \r\n}\r\n```","sha":"227aaf3e14448282894bcbc422531a04dd949f4a"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Miriam <[email protected]>
Closes #189619
Telemetry events created: